package chai.ning.recursion;

/**
 * 1、阶乘 (Factorial):  n! = 1 * 2 * 3 * 4 * .... * (n-1) * n 
 * 2、n! = n * ( n - 1 )!
 * 3、数学中规定 0! 和 1! 都是 1 
 * 4、负数没有阶乘
 */
public class FactorialTest1 {

	public static void main(String[] args) {
		
		final long n = 25 ;
		
		long result = 1 ;
		
		for( long i = n ; i > 0 ; i-- ) {
			result = i * result ;
		}
		
		System.out.println( result );
		
	}

}
